<!DOCTYPE html>
<html>
    <head>
        {# HTML Configuration #}
        <title>{% block title %}{{ site.name }} :: {{ site.slogan }}{% endblock %}</title>
        <meta charset="UTF-8">
        <link rel="icon" type="image/png" href="{{ asset("bundles/openfenneccore/img/favicon.png") }}" />
        {# jQuery Loader #}
        <script type="text/javascript" src="{{ asset("bundles/openfenneccore/js/jquery.min.js") }}"></script>
        {# Twitter Bootstrap Loader #}
        <link rel="stylesheet/less" type="text/css" href="{{ asset("bundles/openfenneccore/less/bootstrap.less") }}" />
        <script type="text/javascript" src="{{ asset("bundles/openfenneccore/js/less.min.js") }}"></script>
        <script type="text/javascript" src="{{ asset("bundles/openfennecore/js/bootstrap.min.js") }}"></script>
        {# Custom Sections #}
        {% block extra_css %}{% endblock %}
        {% block extra_js %}
        <script type="text/javascript">
            $(document).ready(function () {
                $("[rel='tooltip']").tooltip();
            });
        </script>
        {% endblock %}
    </head>
    <body>
        <header class="navbar navbar-static-top navbar-default">
            <nav class="container">
                <div class="navbar-header">
                    <a class="navbar-brand" href="{{ path("openfennec_index") }}">{{ site.name }}</a>
                </div>
                <ul class="nav navbar-nav navbar-left">
                    {% block navbar %}
                        <li><a href="#">Link 1</a></li>
                        <li><a href="#">Link 2</a></li>
                    {% endblock %}
                </ul>
                {% if app.user is empty %}
                    <div class="navbar-btn navbar-right btn-group">
                        <a class="btn btn-default" href="{{ path("openfennec_login") }}">{{ "user.action.log_in"|trans }}</a>
                        <a class="btn btn-default" href="{{ path("openfennec_signup") }}">{{ "user.action.sign_up"|trans }}</a>
                    </div>
                {% else %}
                    <div class="navbar-btn navbar-right btn-group">
                        <a class="btn btn-default" href="{{ path("openfennec_user_profile", {"username": app.user.username}) }}">{{ app.user.nick }}</a>
                        {# <a class="btn btn-default" href="{{ path("openfennec_dashboard") }}" title="{{ "user.dashboard"|trans }}"><i class="fa fa-cog"></i></a> #}
                        <a class="btn btn-default" href="{{ path("openfennec_user_edit") }}" title="{{ "user.action.edit"|trans }}"><i class="fa fa-pencil"></i></a>
                        <a class="btn btn-default" href="{{ path("openfennec_logout") }}" title="{{ "user.action.log_out"|trans }}"><i class="fa fa-sign-out"></i></a>
                    </div>
                    <span class="navbar-text navbar-right"></span>
                {% endif %}
            </nav>
        </header>
        <div class="container">
            {% block notifications %}
            {% for flash in app.session.flashbag.all() %}
                <div class="alert alert-{{ flash.type }} alert-dismissable">
                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                    <span>{{ flash.message }}</span>
                </div>
            {% endfor %}
            {% endblock %}
            {% block body %}
                <aside class="col-lg-4">
                    {% block sidebar %}
                        <div class="well well-sm text-center text-muted">Barra lateral</div>
                    {% endblock %}
                </aside>
                <section class="col-lg-8">
                    {% block content %}
                        <div class="well well-sm text-center text-muted">Contenido</div>
                    {% endblock %}
                </section>
            {% endblock %}
        </div>
        <footer class="container">
            <div class="well well-sm">
                <div class="row">
                    <div class="col-xs-6 text-left">
                        <span class="text-muted"><a href="{{ path("openfennec_index") }}">{{ site.name }}</a> &copy; {{ "now"|date("Y") }}</span>
                    </div>
                    <div class="col-xs-6 text-right">
                        <span class="text-muted">Powered by <a href="http://github.com/atoxic-ar/OpenFennec">OpenFennec</a></span>
                    </div>
                </div>
            </div>
        </footer>
    </body>
</html>
